﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace SignalRTest.Controllers
{
    public class User2Controller : Controller
    {
        [HttpGet]
        // GET: User1
        public ActionResult Login()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Login(string username, string password)
        {

            string token = JWTHelper.Encrypt(username);

            Response.SetCookie(new HttpCookie("singnalrSessionId", token));

            return Redirect("/user2/chat");
        }

        [HttpGet]
        // GET: User1
        public ActionResult Chat()
        {
            return View();
        }
    }
}